package cn.hdustea.shopNavigation.ui.presenter

import cn.hdustea.shopNavigation.entity.UserEntity
import cn.hdustea.shopNavigation.ui.contract.AccountContract
import cn.hdustea.shopNavigation.ui.model.AccountModel
import com.hdustea.base.base.BasePresenter

class AccountPresenter(mView: AccountContract.View) :
        BasePresenter<AccountContract.View, AccountContract.Model>(mView), AccountContract.Presenter {

    override fun getModel(): AccountContract.Model = AccountModel()

    override fun login(username: String, password: String) {
        mModel.login(username, password, object : PresenterCallback<UserEntity>() {
            override fun callback(data: UserEntity) {
                mView?.loginSuccess(data)
            }
        })
    }

    override fun register(username: String, password: String, phone: String) {
        TODO("Not yet implemented")
    }
}